 <?php
/**
 * The Header for our theme.
 */ 
   
/********** Code Index
 *
 * -01- HEADER STUFF
 * -02- START THE BODY
 * -03- GET MENU BAR
 * -04- GET TOP
 * 
 */
 
// ARRAYS CONSISTING OF COLOR SETTINGS OF THE THEME AND THEME OPTIONS
$tlset = get_option( "tlset" );
$ctamarg = $tlset['cro_ctamarg'];

if (isset($ctamarg) && is_numeric($ctamarg)){
	$ctamarg = 'margin-top: ' . $ctamarg . 'px';
} else {
	$ctamarg = 'margin-top: 70px';
}

/**
 * -01- HEADER STUFF
 */ 
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" <?php language_attributes( 'xhtml' ); ?>>
<head profile="http://gmpg.org/xfn/11">
<meta http-equiv="Content-Type" content="<?php bloginfo( 'html_type' ); ?>; charset=<?php bloginfo( 'charset' ); ?>" />
<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
<meta name="viewport" content="width=device-width" />
<?php
echo '<title>' .  wp_title('-' , 0, 'right' ) . '</title>';

$ap = get_mapstack();
if ($ap != '') {echo $ap;}
wp_head();
?>


<!--
 * -02- START BODY
 * 
-->
</head>
<?php 
	if ($ap != '') { ?>
		<body <?php body_class(); ?> onload="initialize()">
	<?php } else { ?>
		<body <?php body_class(); ?>>
	<?php } 
?>

<!--
 * -03- GET MENU BAR
 * 
-->

<div class="bobbg">
	<div class="iiin">
		<div class="iinin">
			

			<div class="menblock">
				<div id="mainmen">
					<div class="row">
						<div class="twelve columns clearfix">
							<?php echo ntfetch_social(); ?>
							<div id="access">	
								<?php 
									if ( has_nav_menu('primary' ) ) {
										wp_nav_menu( array( 'container_class' => 'menu-header', 'theme_location' => 'primary', 'menu_id'  => 'cro-menu' ) ); 
									} 
								?>
							</div>
						</div>
					</div>
				</div>
			</div>

			<div class="headblock">

				<div class="row">
					<div class="seven columns logoside">
						<?php 

						if(isset($tlset['logo']) && $tlset['logo'])  {
							echo '<a href="'. esc_url( home_url( '/' ) ) .'" title="' . esc_attr( get_bloginfo( 'name', 'display' ) ) . '" rel="home"><img class="tllogo" title="' .  esc_attr( get_bloginfo( 'name', 'display' )) . '" src="' .  $tlset['logo'] . '" /></a>';
						} else {
							echo '&nbsp;';
						}
						?>
						<div id="tagline">
							<?php echo $tlset['cro_tagline']; ?>
						</div>
					</div>				
		
					<div class="five columns">
						<?php 
							if ( has_nav_menu('secondnav' ) ) {
								wp_nav_menu( array( 'container_class' => 'secondnav', 'theme_location' => 'secondnav' ) );
							}
						?>	
						<div style="<?php echo $ctamarg; ?>">
							<?php 
								if ( has_nav_menu('thirdnav' ) ) {
									wp_nav_menu( array( 'container_class' => 'thirdnav', 'theme_location' => 'thirdnav' ) );
								}
							?>	
						</div>			
					</div>
				</div>

			</div>
		</div>
	</div>
